package com.edwin.websitebe.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.edwin.websitebe.mapper.MemberMapper;
import com.edwin.websitebe.model.Game;
import com.edwin.websitebe.model.Member;
import com.edwin.websitebe.service.MemberService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements MemberService {

    @Override
    public List<Member> page(String nickname, Integer page, Integer pageSize) {
        return this.getBaseMapper().page(nickname, page, pageSize);
    }

    @Override
    public Member getByMemberName(String memberName) {
        LambdaQueryWrapper<Member> wrapper = new QueryWrapper<Member>().lambda()
                .eq(Member::getMemberName, memberName);
        return getOne(wrapper);
    }

}
